package com.atguigu;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * @program: IDEAcode
 * @description:
 * @author: Mr.zjx
 * create: 2021-08-16-16-07
 **/
public class Test05 {
    public static void main(String[] args) throws IOException {
        //读入
        FileInputStream fis = new FileInputStream("G:\\尚硅谷学习\\学习视频\\Java及数据库\\day19\\笔记\\mytxt\\1.txt");
        //写出
        FileOutputStream fos = new FileOutputStream("G:\\尚硅谷学习\\学习视频\\Java及数据库\\day19\\笔记\\mytxt\\2.txt");
        //定义字节数组
        byte[] bytes = new byte[1024 * 10];
        int len = 0;
        //读取文件
        while ((len = fis.read(bytes))!=-1){
            fos.write(bytes,0,len);
        }
        fis.close();
        fos.close();
    }
}
